package app

import (
    "github.com/gin-gonic/gin"
    "ginweb/internal/controller"
)

func StartServer(userController *controller.UserController, productController *controller.ProductController) {
    r := gin.Default()

    // 注册中间件
    RegisterMiddleware(r)

    // 注册路由
    RegisterRoutes(r.Group("/api/v1"), userController, productController)

    // 启动服务器
    r.Run(":8080")
}